count = int(input())

i = 0
while i<count:
    n,x = map(int,input().split())
    nums = list(map(int,input().split()))
    i += 1
    sum_ = 0
    min_value = nums[0]
    for index in range(len(nums)):
        sum_ += nums[index]
        min_value = min(min_value,nums[index])
    print(sum_ - min_value + x)